package com.yoome.easyrpc.biz.loadbalance.balancer;

import com.yoome.easyrpc.biz.loadbalance.AbstractLoadBalance;
import com.yoome.easyrpc.common.utils.RandomUtil;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RandomBalancer extends AbstractLoadBalance {
    public RandomBalancer() {
        System.out.println("test******");
    }

    @Override
    protected String select(List<String> services, String serviceName) {
        return services.get(RandomUtil.nextInt(services.size()));
    }
}
